#ifndef LEDCUBE_H
#define LEDCUBE_H

#include <p18f2550.h>


#define NO_LEVELS 3
#define COLOR_DEPTH 4

//extern volatile near 
union LEVEL_DATA
{
	struct {
	  unsigned LED0:1;
	  unsigned LED1:1;
	  unsigned LED2:1;
	  unsigned LED3:1;
	  unsigned LED4:1;
	  unsigned LED5:1;
	  unsigned LED6:1;
	  unsigned LED7:1;
	  unsigned LED8:1;
	  unsigned LED9:1;
	  unsigned LED10:1;
	  unsigned LED11:1;
	  unsigned LED12:1;
	  unsigned LED13:1;
	  unsigned LED14:1;
	  unsigned LED15:1;
	};
	long data;
};


               
#define Led1 LATBbits.LATB0
#define Led2 LATBbits.LATB1
#define Led3 LATBbits.LATB2
#define Led4 LATBbits.LATB3
#define Led5 LATBbits.LATB4
#define Led8 LATBbits.LATB5
#define Led7 LATBbits.LATB6
#define Led6 LATBbits.LATB7
#define Led0 LATAbits.LATA0


#define Level0 LATAbits.LATA1
#define Level1 LATAbits.LATA2
#define Level2 LATAbits.LATA3


void high_isr(void); 
void low_isr(void);
void light_level(char level);
void light_leds(union LEVEL_DATA* pData);		
void init_leds(void);


extern int level_counter;
extern int color_counter;
extern union LEVEL_DATA level_data[NO_LEVELS][COLOR_DEPTH];


#endif